Draft
Conversation
15c3594 to
80c069b
Compare
- UaaRequestMatcher: constructor(path, withZonePaths) and withZonePaths()
for matching /z/{id}/path and /z/{id}/path/**
- UaaRequestMatcherTests: @ParameterizedClass with useZonePaths() so
tests run with and without /z/{zoneId}/ prefix
Introduces ZoneRequestPathMode, MockMvcUtils.ZoneResolutionMode, and parameterized MockMvc tests so that tests can run in both subdomain and zone-path modes. After this commit, test permutations that do not use /z/ URLs pass; permutations using /z/ may fail until production support is added.
- IdentityZoneResolvingFilter: resolve zone from path /z/{subdomain}/
- Security configs and controllers: dual paths, withZonePaths() usage
- UaaAuthenticationFailureHandler: zone-aware redirects and cookie path
- Config: zones hostnames for tests
All tests pass after this commit.
7cfabdf to
604e613
Compare
fhanik
commented
Feb 5, 2026
| login.passwordParameter("password"); | ||
| // Support both /login.do and /z/{subdomain}/login.do for zone path-based authentication | ||
| login.loginProcessingUrl("/login.do"); | ||
| login.defaultSuccessUrl("/"); // TODO is this exactly the same? |
Contributor
Author
There was a problem hiding this comment.
This should redirect to /z/{subdomain}
471e7d2 to
a887a36
Compare
a887a36 to
2ca84f0
Compare
444f15a to
0110357
Compare
0110357 to
bd13b7e
Compare
dd9064a to
7c08d52
Compare
public int cleanExpiredEntries() {
long now = timeService.getCurrentTimeMillis();
long lastCheck = lastExpired.get();
if ((now - lastCheck) > expirationInterval && lastExpired.compareAndSet(lastCheck, now)) {
int count = jdbcTemplate.update(deleteExpired, now);
logger.debug("Expiring code sweeper complete, deleted {} entries.", count);
return count;
}
return 0;
}
lastExpired (line 58) is a shared AtomicLong that stores the last time cleanup ran.
Condition: cleanup is only allowed to run when (now - lastCheck) > expirationInterval (e.g. once per minute).
CAS: lastExpired.compareAndSet(lastCheck, now) means: “set lastExpired to now only if it still equals lastCheck.”
So:
Thread A and B both call cleanExpiredEntries() (e.g. from generateCode() in two tests).
Both read lastCheck = lastExpired.get() (e.g. 0 or an old timestamp).
For both, (now - lastCheck) > expirationInterval is true.
One thread (say A) runs compareAndSet(lastCheck, now) first → it succeeds, updates lastExpired to now, then runs jdbcTemplate.update(deleteExpired, now) and deletes expired rows.
Thread B then runs compareAndSet(lastCheck, now) → it fails, because lastExpired was already changed by A, so it’s no longer equal to lastCheck. So B does not run the DELETE and returns 0.
So “another thread won the CAS” = the other thread’s compareAndSet succeeded and did the cleanup; this thread’s compareAndSet failed, so this thread skips the delete. That’s why cleanup may not run in this thread: the design intentionally lets only one thread perform the throttled cleanup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Track Progress In: https://github.com/fhanik/uaa/blob/feature/path-based-zones/docs/path-based-zones-endpoints-without-z-support.md
See #3729